//
//  ParamsHelper.m
//  jandaobao
//
//  Created by 杨志刚 on 15/5/27.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "ParamsHelper.h"
#import "LocationHelper.h"

@implementation ParamsHelper

+ (NSMutableDictionary *) createParams{
    NSMutableDictionary *params = [[NSMutableDictionary alloc]init];
    return params;
}

+ (void)addBelongAgentId:(NSMutableDictionary *)params{
  [params setObject: [LocationHelper  getBelongAgentId] forKey:@"belongAgentId"];
  [params setObject: [LocationHelper  getBelongAgentId] forKey:@"AgentId"];
}

+(void) addCustomerId:(NSMutableDictionary *)params{
  [params setObject: [LocationHelper  getCustomerId] forKey:@"userID"];
    [params setObject: [LocationHelper  getCustomerId] forKey:@"customerId"];
}

+(void) addCurrentAddress:(NSMutableDictionary *)params{
    
    [params setObject: [[NSUserDefaults standardUserDefaults]objectForKey:@"latitude"] forKey:@"latitude"];
    [params setObject: [[NSUserDefaults standardUserDefaults]objectForKey:@"longitude"] forKey:@"longitude"];
}


+(void) addNSInterParams:(NSMutableDictionary *)params :(NSString *)field :(int)value{
       [params setObject:[NSString stringWithFormat:@"%d", value] forKey: field];
}

+(void) addNSStringParams:(NSMutableDictionary *)params :(NSString *)field :(NSString *)value{
    if(value ==nil) return;
    
    [params setObject:value forKey: field];
}

+(void) addObjectParams:(NSMutableDictionary *)params :(NSString *)field :(id)value{
    
    if(value ==nil) return;
    
    [params setObject:value forKey: field];
    
}

+(void) addBooleanParams:(NSMutableDictionary *)params :(NSString *)field :(Boolean)value{
    
    if(value)
    {
     [params setObject:@"Yes" forKey: field];
    }
    else{
       [params setObject:@"No" forKey: field];
    }
}

+(void) addPostByJson:(NSMutableDictionary *)params{
    [self addBooleanParams:params :@"isReturnByJson" :true];
}

+(void) addPostimages:(NSMutableDictionary *)params:(NSString *)ForumId :(NSString *)title:(NSString *)Body{

    [params setObject: ForumId forKey:@"ForumId"];
    [params setObject: title forKey:@"title"];
    [params setObject: Body forKey:@"Body"];
   
}

+(void) addActivePostimage:(NSMutableDictionary *)params :(NSString *)ForumId title:(NSString *)title Description:(NSString *)Description  address:(NSString *)address beginTime:(NSString *)beginTime endTime:(NSString *)endTime{
    

    [params setObject: ForumId forKey:@"ForumId"];
    [params setObject: title forKey:@"title"];
    [params setObject: address forKey:@"Address"];
    [params setObject: beginTime forKey:@"beginTime"];
    [params setObject: endTime forKey:@"endTime"];
    [params setObject: Description forKey:@"Description"];

}



+(void) AddPostConversation:(NSMutableDictionary *)params:(NSString *)topicForumId :(NSString *)body :(NSString *)IpAddress{


    [params setObject: topicForumId forKey:@"topicForumId"];
    [params setObject: body forKey:@"body"];
    [params setObject: IpAddress forKey:@"IpAddress"];
}

@end
